package com.geektime.hello;

/**
 * @Date 2020-10-26 10:56
 * @Author Pzy
 * @Description
 */
public class ExceptionDemo {

    public static void main(String[] args) {
//        exec01();
        for (int i = 0; i < 10; i++) {
            try {
                int r = exec(i);
                System.out.println(r);
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    }

    private static int exec(int i) {
        return 10 / i;
    }

    private static void exec01() {
        try {
            exec02();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    private static void exec02() throws Exception {
        exec03();
    }

    private static void exec03() throws Exception {
        System.out.println("exec03");
    }
}
